extract weekdays from an array in javascript